<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + request.getContextPath();
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="<%=basePath %>/css/updateVideo.css"/>
    <link rel="stylesheet" href="<%=basePath %>/css/list.css">
    <link href="<%=basePath %>/css/H-ui.min.css" rel="stylesheet" type="text/css"/>
    <link href="<%=basePath %>/css/formsCSS.css" rel="stylesheet" type="text/css"/>
    <script src="<%=basePath%>/lib/My97DatePicker/WdatePicker.js"></script>
    <script src="<%=basePath %>/js/jquery.min.js"></script>
    <script src="<%=basePath %>/js/formsJS.js"></script>
    <!-- kindeditor富文本编辑器 -->
    <link href="<%=basePath%>/kindeditor/themes/default/default.css">
    <link href="<%=basePath%>/kindeditor/plugins/code/prettify.css">
    <script src="<%=basePath%>/kindeditor/lang/zh-CN.js"></script>
    <script src="<%=basePath%>/kindeditor/kindeditor-all.js"></script>
</head>
<body>
<div class="connect_wrap">
    <h3 style="text-align: center;">参数配置</h3>
    <div class="row cl" style="max-width:88%;margin-left:8%;">
        <div class="labelText"></div>
        <form action="<%=basePath%>/distribution/configure" method="post" enctype="multipart/form-data">
            <div class="col-sm-4"></div>
            <div class="col-sm-4">
                <div class="boxs">
                    <input type="text" class="inputBox" placeholder="普通推广员佣金比例" name="commissionRate"
                           value="${page.commissionRate}" onkeyup="value=value.replace(/[^\d]/g,'')"/>
                    <input type="text" class="inputBox" placeholder="高级推广员佣金比例" name="highCommissionRate"
                           value="${page.highCommissionRate}" onkeyup="value=value.replace(/[^\d]/g,'')"/>
                    <input type="text" class="inputBox" placeholder="邀请用户佣金比例" name="inviteCommissionRate"
                           value="${page.inviteCommissionRate}" onkeyup="value=value.replace(/[^\d]/g,'')"/>
                    <select class="selectBox" name="condition">
                        <option value="">奖励条件</option>
                        <option value="1" <c:if test="${page.condition eq 1}">selected="selected"</c:if>>天数</option>
                        <option value="2" <c:if test="${page.condition eq 2}">selected="selected"</c:if>>笔数</option>
                    </select>
                    <input type="text" class="inputBox" placeholder="天数或者笔数" name="num" value="${page.num}"
                           onkeyup="value=value.replace(/[^\d]/g,'')"/>
                    <textarea id="h5_notice" placeholder="H5-购买须知" name="h5_notice" class="inputBox kindeditor"
                              style="width: 90%;">${page.h5_notice}</textarea>
                    <textarea id="ios_notice" placeholder="IOS-购买须知" name="ios_notice" class="inputBox kindeditor"
                              style="width: 90%;">${page.ios_notice}</textarea>
                    <textarea id="android_notice" placeholder="ANDROID-购买须知" name="android_notice"
                              class="inputBox kindeditor"
                              style="width: 90%;">${page.android_notice}</textarea>
                    <input type="submit" value="修改" class="true"/>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
<script>
    var h5_notice;
    KindEditor.ready(function (K) {

        h5_notice = K.create('#h5_notice', {
            uploadJson: '<%=basePath%>kindeditor/upload',
            fillDescAfterUploadImage: false,
            allowImageRemote: false,
            afterCreate: function () {
                var self = this;
                K.ctrl(document, 13, function () {
                    self.sync();
                });
                K.ctrl(self.edit.doc, 13, function () {
                    self.sync();
                });
            },
            afterBlur: function () {
                this.sync();
            }
        });
    });

    var ios_notice;
    KindEditor.ready(function (K) {

        ios_notice = K.create('#ios_notice', {
            uploadJson: '<%=basePath%>kindeditor/upload',
            fillDescAfterUploadImage: false,
            allowImageRemote: false,
            afterCreate: function () {
                var self = this;
                K.ctrl(document, 13, function () {
                    self.sync();
                });
                K.ctrl(self.edit.doc, 13, function () {
                    self.sync();
                });
            },
            afterBlur: function () {
                this.sync();
            }
        });
    });

    var android_notice;
    KindEditor.ready(function (K) {

        android_notice = K.create('#android_notice', {
            uploadJson: '<%=basePath%>kindeditor/upload',
            fillDescAfterUploadImage: false,
            allowImageRemote: false,
            afterCreate: function () {
                var self = this;
                K.ctrl(document, 13, function () {
                    self.sync();
                });
                K.ctrl(self.edit.doc, 13, function () {
                    self.sync();
                });
            },
            afterBlur: function () {
                this.sync();
            }
        });
    });
</script>
</html>